# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=actionlint
pkgver=1.7.3
pkgrel=0
pkgdesc="Static checker for GitHub Actions workflow files"
url="https://github.com/rhysd/actionlint"
arch="all"
license="MIT"
makedepends="go ronn"
options="chmod-clean net"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rhysd/actionlint/archive/refs/tags/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags="-buildid= -X github.com/rhysd/actionlint.version=$pkgver -s -w" \
		./cmd/$pkgname
	ronn ./man/$pkgname.1.ronn
}

check() {
	go test .
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 man/$pkgname.1 "$pkgdir"/usr/share/man/man1/$pkgname.1
	install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
e4352881422c78889e237bd280a1432397ae1959ca7257c770207cc5ec405cb47cf7137496c904d98e36a793cc04e0d485e17447db9319bd1d298951fe1ff6a1  actionlint-1.7.3.tar.gz
"
